<template>
  <div class="index">
    <Header></Header>
    <!-- <LeftMenu v-if="ismOrpc"></LeftMenu> -->
    <div  :class="[collapse? 'content-collapse':'', ismOrpc ? 'rightContainer':'rightContainer1']">
      <div class="content">
        <!-- <transition name="move" mode="out-in">
          <keep-alive :include="cachedViews">
            <router-view :key='key'></router-view>
          </keep-alive>
        </transition> -->
        <AppMain/>
      </div>
    </div>
  </div>
</template>

<script>
import Header from "../components/Header";
import LeftMenu from "../components/LeftMenu";
import AppMain from '../components/AppMain'
import bus from "../common/bus";
export default {
  name: "Index",
  data() {
    return {
      tagsList: [],
      collapse: false,
      ismOrpc: true
    };
  },
  components: {
    Header,
    LeftMenu,
    AppMain
  },
  methods: {

  },
  computed:{
      key(){
   			return this.$route.path + Math.random()
   		},
       cachedViews() {//这是新增加的
          return this.$store.state.tagsView.cachedViews
        }//
	  },
  created() {
    this.ismOrpc = this.$store.getters.ismOrpc
    //内容区域跟随变化
    bus.$on("collapse", msg => {
      this.collapse = msg;
    }),
    bus.$on("tags", msg => {
      let arr = [];
      for (let i = 0, len = msg.length; i < len; i++) {
        msg[i].name && arr.push(msg[i].name);
      }
      this.tagsList = arr;
    });
  }
};
</script>
<style scoped lang='scss'>
.index {
  width: 100%;
  height: 100%;
}
.content {
  width: auto;
  height: 80%;
  // margin: 20px;
  box-sizing: border-box;
  // background: #fff;

}
.rightContainer1 {
  padding-top: 146px;
  // background-color: #EEF0F3;
}
.rightContainer {
  // margin-left: 180px;
  padding-top: 146px;
  padding-bottom: 30px;
  transition: margin-left 0.3s ease-in-out;
  // background-color: #EEF0F3;
  // background-color: #f7f7f7;
  // height: 100%;
  box-sizing: border-box;
}
  .content-collapse {
    margin-left: 65px!important;
  }
</style>
